// 商城页面接口
import { myaxios } from "../myaxios";

export const shopApi = {
    /**
     * 获取商城大分类
     */
    queryShopClass() {
        let url = '/shop/class'
        return myaxios.get(url)
    },
    // 获取所有小分类
    queryShopSmallAll() {
        let url = '/shop/small_all'
        return myaxios.get(url)
    },

    /**
     * 通过大分类获取小分类
     * @param { Object } params  {sp_class_id:1}
     * @returns res.data.data
     */
    queryShopSmall(params) {
        let url = '/shop/small'
        return myaxios.get(url, params)
    },

    /**
     * 获取所有商品
     * @param {Object} params {pno:1,pagesize:5}
     * @returns 
     */
    queryAllShop(params) {
        let url = '/shop/all'
        return myaxios.get(url, params)
    },
    /**
     * 通过小类获取数据
     * @param {Object} params {sm_id:1}
     */
    queryShopByClassAndSmall(params) {
        let url = '/shop/by_class_small'
        return myaxios.get(url, params)

    },
    /**
     * 通过关键字模糊查询获取
     * @param {Object} params  {keyword:''}
     * @returns 
     */
    queryShopByKeyword(params) {
        let url = '/shop/bykeyword'
        return myaxios.get(url, params)
    },
    /**
     * @param {Object} params {sp_id:1}
     * @returns 
     */
    queryShopById(params) {
        let url = '/shop/byid'
        return myaxios.get(url, params)
    }

}
